package edu.pku.sei.transformation.mtparser;

import lpg.runtime.*;

/**
 *<em>
 *<li>Rule 83:  Params ::= Param
 *<li>Rule 84:  Params ::= $Empty
 *</em>
 *<p>
 *<b>
 *<li>Rule 82:  Params ::= Params , Param
 *</b>
 */
public class Params extends Ast implements IParams
{
    private IParams _Params;
    private IParam _Param;

    /**
     * The value returned by <b>getParams</b> may be <b>null</b>
     */
    public IParams getParams() { return _Params; }
    public IParam getParam() { return _Param; }

    public Params(IToken leftIToken, IToken rightIToken,
                  IParams _Params,
                  IParam _Param)
    {
        super(leftIToken, rightIToken);

        this._Params = _Params;
        this._Param = _Param;
        initialize();
    }

    public boolean equals(Object o)
    {
        if (o == this) return true;
        if (! (o instanceof Params)) return false;
        if (! super.equals(o)) return false;
        Params other = (Params) o;
        if (_Params == null)
            if (other._Params != null) return false;
            else; // continue
        else if (! _Params.equals(other._Params)) return false;
        if (! _Param.equals(other._Param)) return false;
        return true;
    }

    public int hashCode()
    {
        int hash = super.hashCode();
        hash = hash * 31 + (_Params == null ? 0 : _Params.hashCode());
        hash = hash * 31 + (_Param.hashCode());
        return hash;
    }

    public void accept(Visitor v) { v.visit(this); }
    public void accept(ArgumentVisitor v, Object o) { v.visit(this, o); }
    public Object accept(ResultVisitor v) { return v.visit(this); }
    public Object accept(ResultArgumentVisitor v, Object o) { return v.visit(this, o); }
}


